package com.lz.concurrent;

import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.atomic.AtomicInteger;

public class App {
    public static void main(String[] args) {
        ThreadLocal<Object> objectThreadLocal = new ThreadLocal();
        ConcurrentHashMap concurrentHashMap = new ConcurrentHashMap();
        test01();
    }

    private static void test01() {
        List<Object> objects = new ArrayList<>();
        for(int i=0;i<100;i++){
            objects.add(i);
        }
        AtomicInteger atomicInteger =new AtomicInteger(0);
        objects.forEach(val->{
            int i = atomicInteger.incrementAndGet();
            System.out.println(val);
        });
        System.out.println(atomicInteger.get()+"00");
    }
}
